package com.hooya.fa.eu.api.feign;

import com.hooya.integrated.common.core.constant.ServiceNameConstants;
import com.hooya.integrated.common.core.util.R;
import com.hooya.integrated.thirdpt.api.dto.*;
import com.hooya.integrated.thirdpt.api.vo.InvoicingResultVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @Description 波兰三方服务
 * @Author : Zongz
 * @Copyright Copyright (c) 豪雅集团
 * @Create 2024/6/17
 * @Version 1.0.0
 */
@FeignClient(contextId = "remoteThirdPtService", value = ServiceNameConstants.THIRDPT_SERVICE)
public interface RemoteThirdPtService {

    @PostMapping(value = "/third/pl/add")
    R<InvoicingResultVO> addInvoice(@RequestBody InvoiceDTO dto);

    @PostMapping("/third/pl/update")
    R<InvoicingResultVO> update(@RequestParam("id") Integer id, @RequestBody InvoiceFlushDTO dto);

    @PostMapping("/third/pl/update/detail")
    R<InvoicingResultVO> updateInvoice(@RequestParam("id") Integer id, @RequestBody InvoiceUpdateDTO dto);

    @PostMapping(value = "/third/pl/delete")
    R<String> deleteInvoice(@RequestParam("id") Integer id);

    @GetMapping("/third/pl/get")
    R<InvoicingResultVO> getInvoiceById(@RequestParam("id") Integer id);

    @GetMapping("/third/pl/get/number")
    R<InvoicingResultVO> getInvoiceByNumber(@RequestParam("number") String number);

    @Validated
    @PostMapping("/third/pl/get/list")
    R<List<InvoicingResultVO>> getInvoiceList(@RequestBody @NotNull List<Integer> ids);

    @PostMapping(value = "/third/pl/add/correction")
    R<InvoicingResultVO> addInvoiceCorrection(@RequestBody CorrectionInvoiceDTO dto);

    @PostMapping("/third/pl/update/correction")
    R<InvoicingResultVO> updateInvoiceCorrection(@RequestParam("id") Integer id, @RequestBody CorrectionInvoiceUpdateDTO dto);

}
